package design.simdi.code.final_paper.core.services;

import java.util.List;

import design.simdi.code.final_paper.core.entities.Domain;
import design.simdi.code.final_paper.core.entities.Person;
import design.simdi.code.final_paper.core.entities.Profesor;
import design.simdi.code.final_paper.core.entities.Student;
import design.simdi.code.final_paper.core.entities.User;
import design.simdi.code.final_paper.core.enums.UserStatus;

/**
 * 
 * @author Marius Dumitriu - (May 21, 2010 - 9:09:09 PM)
 * 
 */
public interface UserService {

	public User findUserByNameAndPassword(String username, String password);

	public User findById(Long id);

	public User findUserByLogin(String username);

	public void registerUserStudent(User u, Person p, Student s);

	public void registerUserProfesor(User u, Person p, Profesor prof);

	public void addUser(User u, Person p, Student s, Profesor prof, boolean assignRoles) throws ServiceException;

	public void initDataBase();

	public void assignRole(User u, String rol);
	
	public void removeRole(User u, String rol);

	public List<Domain> getAllDomains();

	public Person findPersonByUser(User user);

	public Profesor findProfesorByUser(User user);

	public Student findStudentByUser(User user);

	public void addProfesorUser(Person professor) throws ServiceException;

	public void registerProfesorUser(Person professor) throws ServiceException;

	// DE FAPT NU FAC STERGERE .. CI DOAR PUN LA USER STATUSUL MARK_FOR_DELETE
	public void removeProfesorUser(Person professor);

	public void addStudentUser(Person student) throws ServiceException;

	public void registerStudentUser(Person student) throws ServiceException;

	// DE FAPT NU FAC STERGERE .. CI DOAR PUN LA USER STATUSUL MARK_FOR_DELETE
	public void removeStudentUser(Person absolvent);

	public void addAbsolventUser(Person student) throws ServiceException;

	public void registerAbsolventUser(Person student) throws ServiceException;

	// DE FAPT NU FAC STERGERE .. CI DOAR PUN LA USER STATUSUL MARK_FOR_DELETE
	public void removeAbsolventUser(Person absolvent);

	public void changeStatus(User user, UserStatus status);
}
